<template>
    <div>
        <h2>{{detail.title}}</h2>
        <div v-for="image in detail.picUrl">
            <img :src="image.url" :alt="image.pic_title">
        </div>
        <main>
            <span>{{detail.content}}</span>
        </main>
    </div>
</template>

<script>
import Axios from "axios";

export default {
    name: "Detail",
    data(){
        return {
            detail : {
                title : '暂无标题',
                picUrl: [
                    {
                        url : '无图片',
                        pic_title : '无',
                    }
                ],
                content: '暂无内容',
            }
        }
    },
    created() {
        this.init();
    },
    methods:{
        init(){
            console.log(this.$route.params.eid)
            Axios.get('/test/queryDetail.php', {
                params:{
                    key: 'd2ecd8fff4c696b09c5d897091fbc616',
                    e_id : this.$route.params.eid,
                }
            }).then(res => {
                console.log(res)
                if (res.data.error_code === 0) {
                    this.detail = res.data.result[0];
                } else {
                    console.log('请求失败' + res.data.reason);
                }
            })
        }
    }
}
</script>

<style scoped>

</style>